/*
 * main.cc
 *
 *  Created on: Nov 29, 2010
 *      Author: fify
 */

#include <iostream>
#include <stdio.h>
#include <string.h>

using namespace std;

const int MAX = 100005;

char buf[MAX];

int numA[MAX];
int numB[MAX];

char strA[MAX];
char strB[MAX];

int char2num[MAX][27];
char num2char[MAX][27];

int base[MAX];

char orth[MAX][27];

void get_base(int n)
{
	int count = 0;
	for(int i = 0;i<n;i++)
	{
		count = 0;
		for(int j = 0;j<26;j++)
		{
			if(orth[i][j])
			{
				char2num[i][j] = count;
				num2char[i][count] = 'a' + j;
				++count;
			}
		}

		base[n - i - 1] = count;
	}
}

void str2num(char str[], int num[], int n)
{
	for(int i = 0;i<n;i++)
	{
		num[i] = char2num[n - i - 1][str[n - i - 1] - 'a'];
	}
}

void num2str(char str[], int num[], int n)
{
	for(int i = 0;i<n;i++)
	{
		str[i] = num2char[i][num[n - i - 1]];
	}

	str[n] = 0;
}

void add(int A[], int B[], int n)
{
	for(int i = 0;i<n;i++)
	{
		A[i+1] += (A[i] + B[i]) / base[i];
		A[i] = (A[i] + B[i]) % base[i];
	}
}

void solve(int n, int m)
{
	memset(orth, -1, sizeof(orth));

	for(int i = 0;i<m;i++)
	{
		scanf("%s", buf);
		for(int j = 0;j<n;j++)
		{
			orth[j][buf[j] - 'a'] = 0;
		}
	}

	scanf("%s", strA);
	scanf("%s", strB);

	get_base(n);

	str2num(strA, numA, n);
	str2num(strB, numB, n);

	add(numA, numB, n);	// A <= A + B

	num2str(buf, numA, n);	// buf <= A

	printf("%s\n", buf);
}
int main()
{
	int n, m;

	while(scanf("%d%d", &n, &m) != EOF)
	{
		solve(n, m);
	}
	return 0;
}
